<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>秒杀配置管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/wechat/seckillConfig/">秒杀配置列表</a></li>
		<shiro:hasPermission name="wechat:seckillConfig:edit"><li><a href="${ctx}/wechat/seckillConfig/form">秒杀配置添加</a></li></shiro:hasPermission>
		<li><a href="${ctx}/wechat/seckill/">秒杀奖品列表</a></li>
		<li><a href="${ctx}/wechat/seckill/form?id=${seckill.id}">秒杀奖品<shiro:hasPermission name="wechat:seckill:edit">${not empty seckill.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="wechat:seckill:edit">查看</shiro:lacksPermission></a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="seckillConfig" action="${ctx}/wechat/seckillConfig/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>名称 ：</label><form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
		&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
	</form:form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead><tr><th>名称</th><th>有效时间</th><th>开始时间</th><th>结束时间</th><th>公告</th><shiro:hasPermission name="wechat:seckillConfig:edit"><th>操作</th></shiro:hasPermission></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="seckillConfig">
			<tr>
				<td><a href="${ctx}/wechat/seckillConfig/form?id=${seckillConfig.id}">${seckillConfig.name}</a></td>
				<td>${seckillConfig.validDays}天</td>
				<td><fmt:formatDate value="${seckillConfig.startTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td><fmt:formatDate value="${seckillConfig.endTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td>${seckillConfig.notice}</td>
				<shiro:hasPermission name="wechat:seckillConfig:edit"><td>
    				<a href="${ctx}/wechat/seckillConfig/form?id=${seckillConfig.id}">修改</a>
					<a href="${ctx}/wechat/seckillConfig/delete?id=${seckillConfig.id}" onclick="return confirmx('确认要删除该秒杀配置吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
